package com.lagou.framework.container;

import com.lagou.framework.common.Request;
import com.lagou.framework.common.Response;
import com.lagou.framework.config.XmlServerConfig;

import java.io.IOException;

/**
 * @author srh
 * @date 2020/04/03
 **/
public class Engine {

    private static Engine instance = new Engine();

    public static Engine getInstance() {
        return instance;
    }

    public void init(XmlServerConfig.Engine engine) {
        Host.getInstance().init(engine.getHost());
    }

    public void doService(Request request, Response response) throws IOException {
        Host.getInstance().doService(request, response);
    }
}
